package com.yc.snack.dao.impl;

import com.yc.snack.dao.IAdminInfoDao;
import com.yc.snack.entity.AdminInfo;
import com.yc.snack.dao.util.DBUtil;

public class AdminInfoDaoImpl implements IAdminInfoDao {

    @Override
    public AdminInfo login(AdminInfo adminInfo) {
        DBUtil db = new DBUtil();
        String sql = "select aid, aname, tel from admininfo where (aname = ? or tel = ?) and pwd = md5(?) and status != 0";
        return db.find(AdminInfo.class, sql, adminInfo.getAname(), adminInfo.getAname(), adminInfo.getPwd());
    }
}
